﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WineDAL
{
    public class WineLoginDAL
    {
        SQLHelper helper = new SQLHelper();
        /// <summary>
        /// 登陆
        /// </summary>
        /// <param name="UsersName"></param>
        /// <param name="UsersPwd"></param>
        /// <returns></returns>
        public ArrayList Login(string UsersName, string UsersPwd)
        {
            SqlParameter[] par = { new SqlParameter("@UsersName", UsersName), new SqlParameter("@UsersPwd", UsersPwd) };
            DataTable table = helper.ExecDataTable_Proc("LoginDo", par);
            //JavaScriptSerializer jss = new JavaScriptSerializer();
            System.Collections.ArrayList dic = new System.Collections.ArrayList();
            foreach (DataRow dr in table.Rows)
            {
                System.Collections.Generic.Dictionary<string, object> drow = new System.Collections.Generic.Dictionary<string, object>();
                foreach (DataColumn dc in table.Columns)
                {
                    drow.Add(dc.ColumnName, dr[dc.ColumnName]);
                }
                dic.Add(drow);
            }
            return dic;
        }
    }
}
